<div class="dataTable_wrapper">
	<table class="table table-striped table-bordered table-hover" id="dataTables-example">
		<thead>
			<tr>
				<?php
					$titles = array();
					$n = 0;
					foreach($head as $k=>$v){
						$titles[] = $k;
						$n++;
						?>
						<th>{$v}</th>
						<?php
					}
				?>
			</tr>
		</thead>
		<tbody>
			<?php
				foreach($body as $k=>$v){
					$trclass = '';
					if($k%2==0){
						$trclass = 'odd';
					}else{
						$trclass = 'even';
					}
					?>
						<tr class="{$trclass}">
					<?php
						for($i = 0; $i<$n; $i++){
						?>
							<td><?php echo ($v[$titles[$i]]); ?></td>
						<?php
						}
					?>
						</tr>
					<?php
				}
			?>
		</tbody>
	</table>
</div>
<script>
	window.onload = function(){
		$(document).ready(function() {
			$('#dataTables-example').DataTable({
					responsive: true
			});
		});
	}

</script>
